<?php
namespace view;

class time{
	
		//@return string (time)
	public function theTime(){
			
		$daynum = date("j");
		$year   = date("Y");
		$hours  = date("H");
		$minutes= date("i");
		$seconds= date("s");
	
	 	$day = $this->getDay();
		$month = $this->getMonth();
	 
		$klocka = $day . " den " . $daynum . " " . $month . "  år " . $year .
				" Klockan är [". $hours . ":" . $minutes . ":" . $seconds . "].";
	
		return $klocka;
	}
	//@return the day "string"
	private function getDay(){
			
		$day    = date("l");
		
		switch($day)
		{
		case "Monday":    $day = "Måndag";  break;
		case "Tuesday":   $day = "Tisdag"; break;
		case "Wednesday": $day = "Onsdag";  break;
		case "Thursday":  $day = "Torsdag"; break;
		case "Friday":    $day = "Fredag";  break;
		case "Saturday":  $day = "Lördag";  break;
		case "Sunday":    $day = "Söndag";  break;
		}
		
		return $day;
	}
	//returns the month "string"
	private function getMonth(){
		
		$month  = date("F");
	
		switch($month)
		{
		case "January":   $month = "Januari";    break;
		case "February":  $month = "Februari";   break;
		case "March":     $month = "Mars";     break;
		case "April":     $month = "April";     break;
		case "May":       $month = "Maj";       break;
		case "June":      $month = "Juni";      break;
		case "July":      $month = "Juli";      break;
		case "August":    $month = "Augusti";    break;
		case "September": $month = "September"; break;
		case "October":   $month = "Oktober";   break;
		case "November":  $month = "November";  break;
		case "December":  $month = "December";  break;
		}
	
		return $month;
	}
}
